//
//  Pennyworth_Punch_Clock_AppDelegate.h
//  Pennyworth Punch Clock
//
//  Created by Chris Karr on 6/30/08.
//  Copyright Northwestern University 2008 . All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#import "NDHotKeyEvent.h"

#include "LoginItemsAE.h"

#define START_AT_LOGIN @"start_at_login"

#define PREDICTION_FETCHED @"Prediction Fetched"
#define KEY @"Key"
#define PREDICTION @"Prediction"
#define UPDATE @"Stream Update"
#define TMP_DIR @"/tmp/pennyworth-punch-clock"

@interface AppDelegate : NSObject 
{
    IBOutlet NSWindow * window;
    
    NSPersistentStoreCoordinator * persistentStoreCoordinator;
    NSManagedObjectModel * managedObjectModel;
    NSManagedObjectContext * managedObjectContext;
	
	NSMutableDictionary * lastSlices;
	
	NSNumber * selectedSliceTag;
	
	IBOutlet NSArrayController * slicesController;
	IBOutlet NSArrayController * streamsController;
	
	NSStatusItem * theItem;
	IBOutlet NSMenu * statusMenu;
	
	IBOutlet NSTabView * mainTabs;

	IBOutlet NSPanel * updatePanel;
	
	IBOutlet id reportManager;
	NDHotKeyEvent * hotKey;
	
	IBOutlet NSTextField * startDateField;
	IBOutlet NSTextField * endDateField;
	IBOutlet NSPanel * datePanel;
}

- (NSPersistentStoreCoordinator *) persistentStoreCoordinator;
- (NSManagedObjectModel *) managedObjectModel;
- (NSManagedObjectContext *) managedObjectContext;

- (IBAction) toggleLog:(id) sender;
- (IBAction) toggleReports:(id) sender;
- (IBAction) togglePreferences:(id) sender;

- (NSString *) applicationSupportFolder;
- (IBAction) saveAction:(id) sender;

- (NSPredicate *) getSliceFilter;

- (IBAction) closeDatePicker:(id) sender;
- (IBAction) invokeDatePanel:(id) sender;
- (NSDictionary *) getActiveState;

@property(retain) NSMutableDictionary * lastSlices;
@property(retain) NSNumber * selectedSliceTag;

@end
